<?php
namespace UserApi\Controller;
use Zend\Mvc\Controller\AbstractRestfulController;
use Zend\View\Model\JsonModel;
class GetorderdetailsApiController extends AbstractRestfulController
{
    public function getList()
    {
		header('Access-Control-Allow-Origin: *');
    }
    public function get($id)
    {	
		header('Access-Control-Allow-Origin: *');
		$userMedicineOrderTable=$this->getServiceLocator()->get('Models\Model\UserMedicineOrderFactory');
		$requestServicesTable=$this->getServiceLocator()->get('Models\Model\RequestServicesFactory');
		$exploredId=explode('-',$id);
		$user_m_id=$id;
		if($exploredId['1']=='0'){
			$getPrescription = $userMedicineOrderTable->getuserorder($exploredId);
		}else{
			$getPrescription = $requestServicesTable->getreqserorder($exploredId['0']);
		}
		if($getPrescription->count()){
			return new JsonModel(array(
				'result'		=> $getPrescription->toArray(),
			));
		}
    }
    public function create($order)
    {	
		
    }
    public function update($order_id,$order)
    {
		
    }
    public function delete($id)
    {
       
    }
}